import { utilJs } from "@/utils/common.js";
const constIndex = {
  state: {
    bindData: {}, //绑定手机号接口所需数据
    userInfoList: [], //绑定手机号 - 合并账号列表
    userAccountList:[], //绑定手机号-平移合并账号列表
    bindVerificationCode:'', //绑定手机号的验证码--传给合并账号用
    showMergeUserModal: false, //引导合并账号弹窗--原绑定手机号弹窗流程拆分
    appConfig: null,
    showNavBar: 0, //是否显示顶部tabbar 1显示 0不显示
    orderDetailNo: '',
    userVipType: 1,
    showAddTeacher: false,
    showAttentionQr: false,
    showGuide: false,
    showVitualModal: false,
    isLoading: false,
    isSkeleton: false,
    clockCalendar: null,
    addressInfo: "",
    clockReTextResult: null,
    clockWrongRightNumber: -1,
    isFirstPlayAudio: true, //音频是不是首次播放
    eBooksSrc: '', //存储电子书的页数
    msgCount: { "system": 0, "system_time": "", "push": 0, "push_time": "", "question": 0, "question_time": "", "comment": 0, "comment_time": "", "income": 0, "income_time": "", "share": 0, "share_time": "" },
    orderList: [], // 商城订单列表
    allOrderList: [], // 订单整合列表
    hasNoticeText: false, //下架、已失效、定时上架时有展示相关信息，避免挡住底部公司信息
    showComplaint: false, //显示app举报弹窗
    // changeTypeBar: 1, //圈子tabBar
    // circleRecommendList: [], //圈子推荐课程选中数据
    showMoreShareModal: false, //推荐有礼遮罩
    showBindPhoneModal: false, //引导绑定手机号弹窗
    showSystemErrorModal: false, //系统繁忙弹窗
    hasModalBindPhone: false,
    currentVideoPlayerIndex: -1, // 当前视频播放的组件索引值
    rightSuspensionIconNum: 0, // 首页/微页面右边悬浮图标数量
  },
  mutations: {
    updateBindData(state, data) {
      state.bindData = data;
    },
    updateUserInfoList(state, list) {
      state.userInfoList = list;
    },
    updateUserAccountList(state, list) {
      state.userAccountList = list;
    },
    updateBindVerificationCode(state, value) {
      state.bindVerificationCode = value;
    },
    updateShowMergeUserModal(state, isShow) {
      state.showMergeUserModal = isShow;
    },
    updateAppConfig(state, appConfig) {
      state.appConfig = {...(state.appConfig || {}), ...appConfig};
    },
    updateShowNavBar(state, showNavBar) {
      state.showNavBar = showNavBar;
    },
    updateOrderDetailNo(state, no) {
      state.orderDetailNo = no;
    },
    updateShowMoreShareModal(state, showMoreShareModal) {
      state.showMoreShareModal = showMoreShareModal
      console.log(state.showMoreShareModal)
    },
    // updateCircleRecommendList(state, circleRecommendList) {
    //   state.circleRecommendList = circleRecommendList
    // },
    updateUserVipType(state, userVipType) {
      state.userVipType = userVipType;
    },
    updateShowAddTeacher(state, showAddTeacher) {
      state.showAddTeacher = showAddTeacher;
    },
    updateEbooksPage(state, eBooksSrc) {
      state.eBooksSrc = eBooksSrc;
    },
    // updateChangeTypeBar(state, changeTypeBar) {
    //   state.changeTypeBar = changeTypeBar;
    // },
    updateShowAttentionQr(state, showAttentionQr) {
      state.showAttentionQr = showAttentionQr;
    },
    updateClockWrongRightNumber(state, resultNum) {
      state.clockWrongRightNumber = resultNum;
    },
    updateClockReTextResult(state, result) {
      state.clockReTextResult = result;
    },
    updateShowGuide(state, showGuide) {
      state.showGuide = showGuide;
    },
    updateShowVitualModal(state, showVitualModal) {
      state.showVitualModal = showVitualModal;
    },
    updateLoadingStatus(state, payload) {
      state.isLoading = payload.isLoading;
    },
    updateSkeletonStatus(state, payload) {
      state.isSkeleton = payload.isSkeleton;
    },
    updateShowBindPhoneModal(state, payload) {
      state.showBindPhoneModal = payload.showBindPhoneModal;
    },
    updateHasModalBindPhone(state, payload) {
      state.hasModalBindPhone = payload.hasModalBindPhone;
    },
    updateAddressInfo(state, info) {
      state.addressInfo = info;
    },
    updateClockCalendar(state, dateStr) {
      state.clockCalendar = dateStr;
    },
    updateIsFirstPlayAudio(state, isFirstPlayAudio) {
      state.isFirstPlayAudio = isFirstPlayAudio;
    },
    updateMsgCount(state, countObj) {
      state.msgCount = countObj;
    },
    updateOrderList(state, orderList) {
      state.orderList = orderList;
    },
    updateAllOrderList(state, allOrderList) {
      state.allOrderList = allOrderList;
    },
    updateHasNoticeText(state, hasNoticeText) {
      state.hasNoticeText = hasNoticeText;
    },
    updateShowComplaint(state, showComplaint) {
      //只有app才有举报
      if (!utilJs.isIOSAppALL() && !utilJs.isAndoridNewApp()) {
        return;
      }
      state.showComplaint = showComplaint;
    },
    updateShowSystemErrorModal(state, showSystemErrorModal) {
      state.showSystemErrorModal = showSystemErrorModal;
    },
    updateCurrentVideoPlayerIndex(state, currentVideoPlayerIndex) {
      state.currentVideoPlayerIndex = currentVideoPlayerIndex;
    },
    updateRightSuspensionIconNum(state, rightSuspensionIconNum) {
      state.rightSuspensionIconNum = rightSuspensionIconNum;
    },
  }
}

export default constIndex
